﻿CREATE PROCEDURE [dbo].[GetNewLaunch]
AS
BEGIN
 -- SET NOCOUNT ON added to prevent extra result sets from
 -- interfering with SELECT statements.
 SET NOCOUNT ON;

    -- Insert statements for procedure here
 SELECT a.ProjectId
      ,a.ProjectName
      ,a.ProjectLocation
      ,a.ProjectDetails
      ,a.ProjectPrice
      ,a.Website
      ,a.CreateDate
      ,a.CreateWho
      ,a.UpdateDate
      ,a.UpdateWho,
      max(g.SmallURL) as PropertyURL 
  FROM [dbo].[Mobile_NewLaunch] a
  left join aw_picture g on a.ProjectId = g.propertyid
  where a.StatusDelete <>1
  group by a.ProjectId
      ,a.ProjectName
      ,a.ProjectLocation
      ,a.ProjectDetails
      ,a.ProjectPrice
      ,a.Website
      ,a.CreateDate
      ,a.CreateWho
      ,a.UpdateDate
      ,a.UpdateWho
  ORDER BY a.UpdateDate
END
